import request from '@/utils/request'

// 房产列表
export const getPropertyList = (params) => request({
  url: '/properties',
  params
})

// 经纪列表
export const getManagerList = (params) => request({
  url: '/agents',
  params
})

// 分类列表
export const getCategoryList = (params) => request({
  url: '/categories',
  params
})

// 新增房产
export const addProperty = (data) => request({
  url: '/properties',
  data,
  method: 'post'
})

// 删除房产
export const delProperty = (id) => request({
  url: '/properties/' + id,
  method: 'delete'
})

// 获取指定房产
export const getPropertyById = (id) => request({
  url: '/properties/' + id
})

// 获取房产数量
export const getPropertyNum = (params) => request({
  url: '/properties/count',
  params
})

// 编辑房产
export const editProperty = (data) => request({
  url: '/properties/' + data.id,
  method: 'put',
  data
})
